#include <linux/notifier.h>
#include "xenbus_comms.h"
+extern struct semaphore xenwatch_mutex;
+
#define streq(a, b) (strcmp((a), (b)) == 0)
static struct notifier_block *xenstore_chain;
struct xenbus_device *dev = to_xenbus_device(_dev);
struct xenbus_driver *drv = to_xenbus_driver(_dev->driver);
const struct xenbus_device_id *id;
+ int ret;
if (!drv->probe)
return -ENODEV;
if (!id)
return -ENODEV;
- return drv->probe(dev, id);
+ down(&xenwatch_mutex);
+ ret = drv->probe(dev, id);
+ up(&xenwatch_mutex);
+ return ret;
}
static int xenbus_dev_remove(struct device *_dev)
* carrying out work.
*/
static pid_t xenwatch_pid;
-static DECLARE_MUTEX(xenwatch_mutex);
+/* static */ DECLARE_MUTEX(xenwatch_mutex);
static DECLARE_WAIT_QUEUE_HEAD(watch_events_waitq);
static int get_error(const char *errorstring)